<template>
  <div>
    <div id="printMe">
      <table class="table1">

      </table>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button @click="dialog = false">取 消</el-button>
      <el-button v-print="{
        id: 'printMe',
        popTitle: ''
      }" type="primary" icon="el-icon-printer">打印</el-button>
    </span>
  </div>
</template>

<script>
  import {
    postHandle
  } from '@/api'
  import WiseFile from "@/components/Crud/components/wiseFile";
  export default {
    components: {
      WiseFile
    },
    props: ['object'],
    data() {
      return {
        obj: {
          name: "",
          fileUrl: null,
          "serialNumber": "",
          "hotApplyUnit": "",
          "hotWorkStartTime": '',
          "hotWorkEndTime": '',
          "workAdminUserName": "",
          "hotLevel": "",
          "hotPlace": "",
          "hotWorkUnitAdmin": "",
          "hotWorkUnitGuardian": "",
          "hotContent": "",
          "hotWorkUnitAdminUserId": "",
          "basicUnitAdminUserId": "",
          "twoProductionAdminUserId": "",
          "towAssetsAdminUserId": "",
          "twoSafetyAdminUserId": "",
          "leaderAdminUserId": "",
          sketchMap: '',
          measure: ''
        },
        dialogVisible: false,
        userList: "/api/v1/welder-uac-second/user-information-comb/get-ent-member",
        jituanList: '/api/v1/welder-sbtx-second/hot-approval-comb/list',
        addUrl: '/api/v1/welder-sbtx-second/hot-program-comb/create',
        options: '',
        value: '',
        value1: [],
      }
    },
    created() {
      
      this.obj = this.object

      this.value1.push(this.object.hotWorkStartTime, this.obj.hotWorkEndTime)
      //this.obj = this.object1
      this.getOptionsItems();
    },
    methods: {
      getOptionsItems() {
        if (this.userList) {
          postHandle(this.userList).then(res => {
            this.options = res.result
          })
        }
      },
      submitHandle() {
        this.drawer = false

        // console.log(this.obj.fileUrl)
        // console.log(this.obj.sketchMap)
        // console.log(this.obj)
        if (this.addUrl) {
          postHandle(this.addUrl, {
            obj: this.obj
          }).then(res => {

            if (res._rd) {
              this.$message({
                message: '创建成功',
                type: 'success'
              });
              this.$emit("hideDijon", false)
            }
          })
        }
      },
      timeChange(a) {
        this.obj.hotWorkStartTime = a[0]
        this.obj.hotWorkEndTime = a[1]
      }
    }
  }
</script>

<style scoped>
  table {
    border-collapse: collapse;
  }

  table,
  table tr,
  table tr th {
    line-height: 41px;
    border: 1px solid #000000;
    vertical-align: top;
  }

  .title {
    text-align: left;
    line-height: 40px;
  }

  input {
    border: none;
    width: 100%;
    height: 100%;
    outline: none;
    padding-left: 20px;
    height: 30px;
    color: rgb(126, 126, 126);
    font-weight: bold;
  }

  .table1 tr th {
    min-width: 200px;

  }

  textarea {
    border: none;
    outline: none;
    padding: 10px;
    resize: none;
    width: 100%;
    min-height: 100px;
    color: rgb(126, 126, 126);
    font-weight: bold;
  }

  .input {
    width: 200px;
  }

  .input1 {
    width: 150px;
  }

  .noborder {
    border: none;
  }

  .borderTop {
    border-top: 1px solid #000000;
  }

  .textTop {
    vertical-align: top;
  }

  select {
    width: 100%;
    height: 30px;
    margin: 15px 10px;
    color: rgb(126, 126, 126);
    font-weight: bold;
  }

  .width40 {
    width: 40%
  }

  .botDesc {
    padding-top: 10px;
    padding-left: 100px;
  }

  .botDesc p {
    line-height: 40px;
  }

  .qianzi {
    width: 180px
  }

  .qianzi1 {
    width: 130px
  }

  .el-select {
    width: 140px
  }

  .upload {

    /* height: 40px; */
  }

  /deep/ .el-upload--picture-card {
    margin: 10px;
    /* height: 100%; */
    /* line-height: 50px; */
  }

  /deep/ .el-upload-list--picture-card .el-upload-list__item {
    margin: 10px;
  }
</style>